import os
import pyautogui
import uiautomation
from config.config import DATA_PATH
from page.index import IndexPage
from page.住院管理.zhuyuandengji__page import zhuyuandengji

from tools.sjqd_way import read_data_from_excel


class Tiaoshi():
    his = uiautomation.WindowControl(searchDepth=1, Name='科玛奇医院信息管理系统')  # 锁定窗口
    his.SetFocus()
    def tuikuanchuli(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "住院患者基础信息")
        brfb,fffs,rybq,ryks,rytj,xyjb,xxdz = self.data[0]
        ap = IndexPage()
        bp = zhuyuandengji()
        ap.click_zygl_btn()  # 点击住院管理
        ap.click_zydj_btn()  # 点击住院登记
        bp.zhuyuandengjichuangkou.Maximize()#最大化窗口
        bp.creat_zyhz(brfb,fffs,rybq,ryks,rytj,xyjb,xxdz)
        # bp.input_brfb(brfb)
        # bp.input_xm() #输入患者姓名
        # bp.choose_xb()#选择患者性别
        # bp.input_age()#输入患者年龄
        # bp.choose_fffs(fffs)
        # bp.input_rybq(rybq)#选择入院病区
        # bp.input_ryks(ryks)#选择入院科室
        # bp.input_rytj(rytj)#选择入院途径
        # bp.input_xyjb(xyjb)
        # bp.input_address(xxdz)#输入详细地址
        # bp.input_num()#输入电话号码
        # bp.click_qd_btn()#点击确定按钮
        # bp.cliick_tsqx_btn()#点击提示确定按钮
        bp.zhuyuandengjichuangkou.GetWindowPattern().Close()#关闭窗口
if __name__ == '__main__':
    Tiaoshi().tuikuanchuli()
